package com.saikei.demoapp

import android.util.Log
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.viewModelScope
import com.saikei.demoapp.base.BaseInitVMActivity
import com.saikei.demoapp.util.IntentStarter
import com.saikei.demoapp.databinding.ActivityMainBinding
import com.saikei.demoapp.util.Coroutine
import kotlinx.coroutines.delay

class Main2Activity : BaseInitVMActivity<ActivityMainBinding, MainVm>() {

    companion object {
//        fun start(any: Any, data: String) {
//            IntentStarter.create(any).withData("data", data, "sss", data)
//                .startActivity(Main2Activity::class.java)
//        }
    }

    override fun initView() {
    }

    override fun initData() {
    }

    override fun initObserve() {
        mViewModel.asyncLoad {
            delay(10000)
            "你好"
        }.onSuccess {
            Log.e("TAG", "日志: ${it.toString()}")
        }.onError {

        }.onStart {

        }
    }

    override fun getVmBr(): Int {
        return BR.vm
    }

    override fun getPageBr(): Int {
        return BR.page
    }
}